Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add git hash and tags for versioning #839

Closed
wants to merge 4 commits into from

Conversation

alex-nitrokey
Copy link
Contributor

The reasoning behind this small set of changes is to make versioning and referencing more easy. I do not know if this is desired, but for example having the builds locally with hash instead of overwriting every build is nice to have imho.

Please have a look if heads can use anything of that. :)

* create all git related variables before importing configs to make it
  possible to use them in the board configs (e.g. for heads title)
* add tags, short hash and branch information
* export git tag to use it in system info as well
* always create a copy of coreboot.rom containing tag and hash
@alex-nitrokey
Copy link
Contributor Author

This PR is not doing meaningful things in the CI. I may have a second look next week. Otherwise I might just close the PR.

@tlaurion
Copy link
Collaborator

tlaurion commented Sep 25, 2020

@alex-nitrokey there is a need to rethink deeply the versioning scheme of heads since fwupd has landed and requires such change in the thinking of versions. Versioning would require board name and tag names minimally.

The idea here would be to reintegrate git tags so we try to follow coreboot releases.

@tlaurion
Copy link
Collaborator

Goal would be to arrive to something like this with board version and maybe the timestamp of the tag?

@alex-nitrokey
Copy link
Contributor Author

@alex-nitrokey there is a need to rethink deeply the versioning scheme of heads since fwupd has landed and requires such change in the thinking of versions. Versioning would require board name and tag names minimally.
The idea here would be to reintegrate git tags so we try to follow coreboot releases.

Glad to hear that there are changes on the way anyway! I try to have a look at the fwupd stuff these days. Thanks for letting me know!

Makefile Outdated Show resolved Hide resolved
@@ -83,6 +83,7 @@ $(build)/$(coreboot_dir)/.build: \
$(build)/$(BOARD)/coreboot.rom: $(build)/$(coreboot_dir)/.build
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something for a follow-on: coreboot.rom isn't the most useful output name, something like Heads-<board>-<tag>.rom would be far better. When building for a half dozen+ boards, having to rename manually to something useful after every build becomes very tiresome.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Until now I only added heads- to the copy of coreboot.rom. If I rename the coreboot.rom I need to change the CI files and maybe other things too, right?

Copy link
Collaborator

@tlaurion tlaurion Oct 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alex-nitrokey : CircleCI backups the content of the build dir altogether, while gitlabci is currently foo bar, whiule the same logic used to CircleCI (backup build dir instead of individual files) should be taken anyway.

@tlaurion
Copy link
Collaborator

tlaurion commented Oct 2, 2020

@alex-nitrokey whenever ready, please rebase on master to trigger a build.

@alex-nitrokey
Copy link
Contributor Author

@tlaurion I am sorry for the delay. I am a bit confused now. Do you like to have a versioning based on this PR and change to another one later on? Because you first posts sounded more like this approach would not fit the planned layouts and this PR is useless for heads therefore.
Shall I insert you suggestions and fix this PR?

@tlaurion
Copy link
Collaborator

@tlaurion I am sorry for the delay. I am a bit confused now. Do you like to have a versioning based on this PR and change to another one later on?

@alex-nitrokey : Yes. I think it should be cleaner and the name of the builds should talk for themselves. Didn't review this PR yet, but the idea would be to have tags accociated with github future releases, for which versions could be evaluated by the OS (fwupd).

Suggestion from FWUPD PR is to change current coreboot CONFIG_LOCALVERSION="heads" to something dynamic and for which an external tool can easily evaluate of current version is older then the one indexed in LVFS CONFIG_LOCALVERSION="0.2.1 heads"

Because you first posts sounded more like this approach would not fit the planned layouts and this PR is useless for heads therefore.
Shall I insert you suggestions and fix this PR?

@tlaurion
Copy link
Collaborator

@alex-nitrokey : had review the artifacts produced https://app.circleci.com/pipelines/github/Nitrokey/heads/123/workflows/4aade83f-1c1e-4c8a-bd04-c5b49bcbf21e/jobs/129/artifacts:

    build/librem_mini/bzImage
    build/librem_mini/coreboot.rom
    build/librem_mini/hashes.txt
    build/librem_mini/heads--v0.2.0-918-g6f0d.rom
    build/librem_mini/heads.cpio
    build/librem_mini/initrd.cpio.xz
    build/librem_mini/logs.tar.gz
    build/librem_mini/modules.cpio
    build/librem_mini/tools.cpio
    build/qemu-coreboot/bzImage
    build/qemu-coreboot/coreboot.rom
    build/qemu-coreboot/hashes.txt
    build/qemu-coreboot/heads--v0.2.0-918-g6f0d.rom
    build/qemu-coreboot/heads.cpio
    build/qemu-coreboot/initrd.cpio.xz
    build/qemu-coreboot/logs.tar.gz
    build/qemu-coreboot/modules.cpio
    build/qemu-coreboot/tools.cpio
    build/t430-flash/bzImage
    build/t430-flash/coreboot.rom
    build/t430-flash/hashes.txt
    build/t430-flash/heads--v0.2.0-918-g6f0d.rom
    build/t430-flash/heads.cpio
    build/t430-flash/initrd.cpio.xz
    build/t430-flash/logs.tar.gz
    build/t430-flash/modules.cpio
    build/t430-flash/t430-flash.rom
    build/t430-flash/tools.cpio
    build/t430/bzImage
    build/t430/coreboot.rom
    build/t430/hashes.txt
    build/t430/heads--v0.2.0-918-g6f0d.rom
    build/t430/heads.cpio
    build/t430/initrd.cpio.xz
    build/t430/logs.tar.gz
    build/t430/modules.cpio
    build/t430/tools.cpio
    build/x230-flash/bzImage
    build/x230-flash/coreboot.rom
    build/x230-flash/hashes.txt
    build/x230-flash/heads--v0.2.0-918-g6f0d.rom
    build/x230-flash/heads.cpio
    build/x230-flash/initrd.cpio.xz
    build/x230-flash/logs.tar.gz
    build/x230-flash/modules.cpio
    build/x230-flash/tools.cpio
    build/x230-flash/x230-flash.rom
    build/x230-hotp-verification/bzImage
    build/x230-hotp-verification/coreboot.rom
    build/x230-hotp-verification/hashes.txt
    build/x230-hotp-verification/heads--v0.2.0-918-g6f0d.rom
    build/x230-hotp-verification/heads.cpio
    build/x230-hotp-verification/initrd.cpio.xz
    build/x230-hotp-verification/logs.tar.gz
    build/x230-hotp-verification/modules.cpio
    build/x230-hotp-verification/tools.cpio
    build/x230/bzImage
    build/x230/coreboot.rom
    build/x230/hashes.txt
    build/x230/heads--v0.2.0-918-g6f0d.rom
    build/x230/heads.cpio
    build/x230/initrd.cpio.xz
    build/x230/logs.tar.gz
    build/x230/modules.cpio
    build/x230/tools.cpio

The idea here would be that the artifacts would be named after their board names
heads-x230-v0.2.0-918-g6f0d, where @macpijan should give more precise advises on naming scheme, maybe, so the naming and versioning scheme matches LVFS requirements, while the artifacts outputs have sense for devs without having coreboot.rom everywhere. :)

@MrChromebox
Copy link
Contributor

heads-x230-v0.2.0-918-g6f0d

heads-$BOARD-$(git describe --tags --dirty)-$(git rev-parse --short HEAD).rom is pretty much perfect, as long as we create new tags on a regular basis. v0.2.0-918 just screams that we haven't had a release in ages

@macpijan
Copy link
Contributor

@Asiderr Does it look fine from the LVFS perspective?

@tlaurion
Copy link
Collaborator

@alex-nitrokey, @MrChromebox @macpijan @Asiderr
Main unanswered question here is how we would dynamically replace CONFIG_LOCALVERSION="heads" is all coreboot configurations, so that version is exposed to the OS, which is required by fwupd to compare versions from the OS perspective.

https://github.com/osresearch/heads/search?q=CONFIG_LOCALVERSION%3D%22heads%22&type=code

I have no answer.

@MrChromebox
Copy link
Contributor

@tlaurion perhaps, in the coreboot makefile, after copying the board coreboot config to $(build)/$(coreboot_dir)/.config, use a shell call to sed to replace CONFIG_LOCALVERSION value with CONFIG_HEADS_VERSION value, which is exported from the main makefile? I'll play with it some

@MrChromebox
Copy link
Contributor

@tlaurion see #859

@Asiderr
Copy link

Asiderr commented Oct 18, 2020

@tlaurion @macpijan @MrChromebox @alex-nitrokey Versioning looks fine from the LVFS perspective. As @tlaurion mentioned, the main thing is to pass the current version to the Qubes OS to make it available for fwupd. @MrChromebox approach seems to be correct.

@tlaurion
Copy link
Collaborator

@alex-nitrokey @MrChromebox https://app.circleci.com/pipelines/github/MrChromebox/heads/25/workflows/0f5254de-a777-4f27-b129-693cc304bf4e/jobs/27 fails for x230-flash board, but the naming scheme of sucessfully build librem_mini looks like build/librem_mini/heads-librem_mini-v0.2.0-917-g19f0e65.rom

Once all output boards are confirmed to be clean, please decide on the way you want this to be merged upstream.
@MrChromebox cherry-picking and adding up to #839? So #859 supersedes #839?

@tlaurion
Copy link
Collaborator

tlaurion commented Oct 18, 2020

Please tag me back for followup. linked to #834 and #859

@tlaurion
Copy link
Collaborator

Is that superseded by #859 @alex-nitrokey ? I think so

@daringer daringer deleted the git_hashes branch November 15, 2023 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants